<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./lib/bootstrap.css">

</head>
<body>
    <div class="box" id="app">
        <table class="table table-bordered table-hover">
            <thead>
                <th>index</th>
                <th>姓名</th>
                <th>年龄</th>
            </thead>
            <tbody>
                <!-- 官方建议，只要用到v-for，一定要绑定key属性，把id作为key的值 字符串或数字类型-->
                <tr v-for="(item,i) in list" :key="item.id" :title="i">
                    <td>{{i}}</td>
                    <td>{{item.username}}</td>
                    <td>{{item.age}}</td>
                </tr>
            </tbody>
        </table>
    </div>
    <script src="./lib/vue-2.6.12.js"></script>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                list: [
                    {
                        id:1,
                        username:'zs1',
                        age:18,
                    },
                    {
                        id: 2,
                        username: 'zs2',
                        age: 18,
                    },
                    {
                        id: 3,
                        username: 'zs3',
                        age: 18,
                    },
                ]
            },
            methods: {
                
            }
        })
    </script>
</body>
</html>